import getState from "@/api/state";
import InsuranceType from "@/template/InsuranceType/InsuranceType";
import ZuiEchart from "@/template/zuiEchart/zuiEchart";
import React from "react";
import { useEffect } from "react";
import { useState } from "react";

const Base4 = ({ condition }) => {
    const [message, setMessage] = useState("暂无数据");
    const [loading, setLoading] = useState(false)
    const [state, setState] = useState({
        data: [

        ]
    })

    useEffect(() => {
        getState({
            apiUrl: "/cifgp-core-api/baseQuery/pieChart",
            state,
            condition: { ...condition, cType: "baseNationality" },
            setState,
            setLoading,
            setMessage
        })
    }, [condition])

    return (
        <>
            {/* <InsuranceType
                message={message}
                loading={loading}
                style={{ width: "25%", height: "250px" }}
                ItemHeight="100%"
                title="国籍分布"
                hideBtn
                data={[
                    state
                ]}
                unit="客户量"
                fieldNames={{
                    name: "",
                    value: "个"
                }}
            /> */}
            <ZuiEchart
                message={message}
                loading={loading}
                style={{ width: "25%", height: "250px" }}
                title="国籍分布"
                data={[
                    state
                ]}
                defaultModule="pie"
                pieType={"2"}
                unit="个"
            />
        </>
    )
}
export default Base4;